<?php
//PLUGIN type=frontend
//PLUGIN name=breadcrumb
//PLUGIN desc=Adds breadcrumb generation
//PLUGIN group=general
global $smarty, $options, $page_lookup;

$crumb = array();
$breadcrumb_array = array();

$breadcrumb_work_string = $options['page']."/";
$breadcrumb_work_array = explode("/", $breadcrumb_work_string);
array_pop(&$breadcrumb_work_array);
$breadcrumb_work_array[0]="/";
foreach ($breadcrumb_work_array as $k => $b) {
    if($b == "") continue ;
    $w_string = "";
    for($i = 1; $i <= $k; $i++) {
        $w_string .= "/".$breadcrumb_work_array[$i];
    }
    if($w_string == "") $w_string ="/";
    $crumb[] = $page_lookup[$w_string];
}
$smarty->assign("breadcrumb", $crumb);
?>